package com.nb.nbbase2.exception;

import com.nb.nbbase2.model.Result;
import com.nb.nbbase2.model.ResultEnum;
import lombok.Getter;

/**
 * @date 2024年10月02日 20:06
 */
@Getter
public class BizException extends RuntimeException {

    private  int code;

    private  String msg;

    public BizException(int code,String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }

    public BizException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMsg();
    }
}
